import request from '../utils/request'

// 獲取聊天歷史記錄
export function getChatHistory(params) {
  return request({
    url: '/api/chat/history',
    method: 'get',
    params
  })
}

// 上傳聊天圖片
export function uploadChatImage(data) {
  return request({
    url: '/api/chat/upload/image',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 上傳聊天文件
export function uploadChatFile(data) {
  return request({
    url: '/api/chat/upload/file',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 保存會議記錄
export function saveMeetingRecord(data) {
  return request({
    url: '/api/meeting/record',
    method: 'post',
    data
  })
}

// 獲取會議記錄列表
export function getMeetingRecords(params) {
  return request({
    url: '/api/meeting/records',
    method: 'get',
    params
  })
}

// 獲取會議詳情
export function getMeetingDetail(id) {
  return request({
    url: `/api/meeting/detail/${id}`,
    method: 'get'
  })
}

// 發送會議邀請
export function sendMeetingInvite(data) {
  return request({
    url: '/api/meeting/invite',
    method: 'post',
    data
  })
}

// 接受會議邀請
export function acceptMeetingInvite(data) {
  return request({
    url: '/api/meeting/accept',
    method: 'post',
    data
  })
}

// 拒絕會議邀請
export function rejectMeetingInvite(data) {
  return request({
    url: '/api/meeting/reject',
    method: 'post',
    data
  })
}

// 結束會議
export function endMeeting(data) {
  return request({
    url: '/api/meeting/end',
    method: 'post',
    data
  })
} 